<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>markdown</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.0/showdown.min.js"></script>
</head>
<body>
<div>

    <textarea id="oriContent" style="height:400px;width:600px;float: left" onkeyup="convert()"></textarea>

    <div id="result" style="float: left"></div>

</div>

<script type="text/javascript">
    function convert(){
        var text = document.getElementById("oriContent").value;
        var converter = new showdown.Converter();
        var html = converter.makeHtml(text);
        document.getElementById("result").innerHTML = html;
    }
</script>
</body>
</html>